package com.example.consumer.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;


/**
 * @description: 事务消息消费者
 * @author TAO
 * @date 2021/12/28 12:33 上午
 */
@Slf4j
@Component
//@RocketMQMessageListener(consumerGroup = "${rocketmq.producer.groupName1}", topic = "TX_ORDER_ADD",consumeMode = ConsumeMode.ORDERLY)
@RocketMQMessageListener(consumerGroup = "transaction-group", topic = "transaction-str",consumeMode = ConsumeMode.ORDERLY)
public class TransactionConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String str) {
        log.info("===>"+str);
    }

}
